package com.lvs.zmwz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lvs.zmwz.comm.DictionaryEnum;
import com.lvs.zmwz.entity.OrderList;
import com.lvs.zmwz.entity.Shop;
import com.lvs.zmwz.mapper.ShopMapper;
import com.lvs.zmwz.service.IShopService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lvs.zmwz.util.QPage;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 
 * @since 2022-07-21
 */
@Service
public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements IShopService {

    /**
     * 商品列表
     * @param qPage
     * @param sysManagerSearch
     * @return
     */
    @Override
    public IPage<Shop> getListAll(QPage qPage, Shop sysManagerSearch) {
        QueryWrapper<Shop> queryWrapper=new QueryWrapper<>();
        queryWrapper.lambda().like(StringUtils.isNotEmpty(sysManagerSearch.getShopName()),Shop::getShopName,sysManagerSearch.getShopName());
        queryWrapper.lambda().eq(StringUtils.isNotEmpty(sysManagerSearch.getTypeId()),Shop::getTypeId,sysManagerSearch.getTypeId());
        queryWrapper.eq("is_del", DictionaryEnum.IS_DEL_N.getCode());
        queryWrapper.orderByDesc("ctime");
        IPage<Shop> hjManagerIPage=this.page(new Page<>(qPage.getOffset(), qPage.getLimit()),queryWrapper);
        return hjManagerIPage;
    }


}
